<?php

class Book_Component_Controller_Index extends Phpfox_Component {

    public function process() {
        
        //get all books
        $books = Phpfox::getService('book')->getBooks();
        $this->template()->assign('books', $books);

        //service
        $aUsers = Phpfox::getService('book')->getUsers(10);
        $this->template()->assign('aUsers', $aUsers);

        //Connect with CSS & JavaScript
        //$this->template()->setHeader('<!-- Add me in the header -->');  
        $this->template()->setHeader(array(
            'sample.css' => 'module_book',
            'sample.js' => 'module_book'
                )
        );

        //Set a Title & Breadcrumb
        $this->template()->setTitle("Browse All");
        $this->template()->setBreadcrumb("Browse All");

        //Set Meta Keywords & Description
//        $this->template()->setMeta('keywords', 'phrase1, phrase2, phrase3');
//        $this->template()->setMeta('description', 'This is a sample page.');
        //Assigning Variables to HTML Files
        $this->template()->assign(array(
            'sSampleKey1' => 'Sample Value 1',
            'sSampleKey2' => 'Sample Value 2',
            'sSampleKey3' => 'Sample Value 3',
            'sSampleKey4' => 'Sample Value 4'
                )
        );
    }

}
